<?php

namespace app\common\model;

class Notice extends Base
{
####################################################--ADMIN--start--#####################################################
    /**
     * @author [南風]
     * @param $map
     * @return int|string
     */
    public function getNoticeCountByCondition($map)
    {
        return $this->where($map)->count();
    }

    /**
     * @author [南風]
     * @param $map
     * @param $from
     * @param $size
     * @return array
     */
    public function getNoticeByCondition($map, $from, $size)
    {
        $lists = $this->where($map)
                    ->limit($from, $size)
                    ->order('create_time desc')
                    ->select();

        return $lists;
    }


}